home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98a.txt / 000134_icon-group-sender _Mon Mar 16 08:02:19 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA19538
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 16 Mar 1998 08:02:18 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA18581; Mon, 16 Mar 1998 08:02:18 -0700
  7. From: gep2@computek.net
  8. Date: Fri, 13 Mar 1998 21:13:47 -0600
  9. Message-Id: <199803140313.VAA32085@axp.cmpu.net>
  10. Mime-Version: 1.0
  11. Content-Type: text/plain
  12. Content-Transfer-Encoding: 7bit
  13. Subject: Re: Letter Probabilities
  14. To: icon-group@optima.CS.Arizona.EDU
  15. X-Mailer: SPRY Mail Version: 04.00.06.17
  16. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  17. Status: RO
  18. Content-Length: 1445
  19.  
  20. > (1) Some letters occur with vanishingly small, but nonzero,
  21. probabilities.  In order to handle them, the generator string would have
  22. to be extremely long just to have the letter occur once or twice in the
  23. string!  We are talking about several thousand characters in a string.
  24.  
  25. Yes.  The string will be long according to the resolution of the probabilities 
  26. you wish to achieve.  I would imagine, however, that a string of 1K-20K 
  27. characters in length would easily achieve the probability resolution you desire.
  28.  
  29. > (2) There is a more elegant Icon syntax for producing a random character
  30. from a string, namely ?string.  I assume that this operator assumes
  31. equal probability for each letter in the string, namely 1/N where N =
  32. *string.
  33.  
  34. Right, and I'd start by using that one.  If you decide that the built-in random 
  35. number generator is insufficiently random for your purposes, you can of course 
  36. later substitute whatever other generator you like and explicitly index into the 
  37. string using the random subscript.
  38.  
  39. > When I
  40. first rejected the idea, it was because I had the impression that Icon
  41. could not handle strings of more that 255 characters.  That appears not
  42. to be the case.
  43.  
  44. It certainly is not the case.  :-)  You can have strings of nearly any 
  45. reasonable length (in fact, up to quite UNreasonable lengths).  :-)
  46.  
  47. Gordon Peterson
  48. http://www.computek.net/public/gep2/
  49. Support the Anti-SPAM Amendment!  Join at http://www.cauce.org/
  50.  
  51.